package com.wkbb.sports.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.wkbb.sports.model.BaseEntity;
import com.wkbb.sports.model.HlifeWorkRule;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author lbh
 * @date 2021年03月29日 17:58:34
 * @description:   作业信息要求数据传输包装类
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class WorkDto extends BaseEntity {

    @ApiModelProperty(value = "作业ID")
    private Long workId;
    @ApiModelProperty(value = "是否需要实名认证")
    private Boolean faceRecognition;
    @ApiModelProperty(value = "项目ID")
    private Byte projectId;
    @ApiModelProperty(value = "项目名称")
    private String projectName;
    @ApiModelProperty(value = "学校ID")
    private Long orgId;
    @ApiModelProperty(value = "年级ID")
    private Long gradeId;
    @ApiModelProperty(value = "年级名称")
    private String gradeName;
    @ApiModelProperty(value = "班级ID")
    private Long classId;
    @ApiModelProperty(value = "班级名称")
    private String className;
    @ApiModelProperty(value = "教师ID")
    private Long teacherId;
    @ApiModelProperty(value = "教师名称")
    private String teacherName;
    @ApiModelProperty(value = "教师头像地址")
    private String headImgUrl;

    @ApiModelProperty(value = "结束时间 - 年月日")
    private String ymTime;
    @ApiModelProperty(value = "结束时间 - 时分")
    private String dTime;
    @ApiModelProperty(value = "结束时间（格式化）")
    private String time;
    @ApiModelProperty(value = "时长（格式化）")
    private String durationFormat;
    @ApiModelProperty(value = "时长(秒)")
    private Integer totalTime;
    @ApiModelProperty(value = "单位(1千克/米²,2毫升,3分,4秒,5米,6厘米,7次)")
    private Integer unit;
    @ApiModelProperty(value = "备注")
    private String remark;
    @ApiModelProperty(value = "是否达标(0未达标/1已达标)")
    private Integer reached;
    @ApiModelProperty(value = "状态(0未开始 1进行中2已结束3已取消)")
    private Integer status;
    @ApiModelProperty(value = "学生ID")
    private Integer studentId;
    @ApiModelProperty(value = "学生名称")
    private String studentName;
    @ApiModelProperty(value = "性别(1男/2女)")
    private byte sex;
    @ApiModelProperty(value = "工号或学号")
    private String userNo;
    @ApiModelProperty(value = "模式(1模拟考试 2限时限数 3数量模式 4时间模式)")
    private Integer modelType;
    @ApiModelProperty(value = "修改时间")
    private Date updateTime;
    @ApiModelProperty(value = "修改时间")
    private Date endTime;
    @ApiModelProperty(value = "修改时间")
    private Date beginTime;
    @ApiModelProperty(value = "实际时长(单位：秒)")
    private Integer actualTime;
    @ApiModelProperty(value = "规则性别限制(1男 2女3不限4区分男女)")
    private Integer ruleSex;
    @ApiModelProperty(value = "达标总人数")
    private Integer total;


    @ApiModelProperty(value = "最终拼接的时间")
    private String finalTime;
    private String jumpType;
    private String sortTime;
    @ApiModelProperty(value = "时长")
    private Integer duration;
    private Integer number;
    private Integer boyNumber;
    private Integer diff;
    private Integer girlNumber;
    private Integer boyDuration;
    private Integer girlDuration;

    public String getIntro() {
        String str = "";
        switch (modelType){
            case 2:
                if (ruleSex == 3){
                    str = duration+"分钟"+number+"次";
                }else{
                    str = "男："+boyDuration+"分钟"+boyNumber+"次 女："+girlDuration+"分钟"+girlNumber+"次";
                }
                break;
            case 3:
                if (ruleSex == 3){
                    str = number+"次";
                }else{
                    str = "男："+boyNumber+"次 女："+girlNumber+"次";
                }
                break;
            case 4:
                if (ruleSex == 3){
                    str = duration+"分钟";
                }else{
                    str = "男："+boyDuration+"分钟 女："+girlDuration+"分钟";
                }
                break;
        }
        return str;
    }
}
